<?php

class Application_Form_Article extends Zend_Form
{
    public function init()
    {
        $this->setName('article');

        $article_id = new Zend_Form_Element_Hidden('article_id');
        $article_id->addFilter('Int');
		
		$language = new Zend_Form_Element_Multiselect('language');
        $language->setLabel('language');

        $main_title = new Zend_Form_Element_Text('main_title');
        $main_title->setLabel('Main title')
              ->setRequired(true)
              ->addFilter('StripTags')
              ->addValidator('NotEmpty');

        $sub_title = new Zend_Form_Element_Text('sub_title');
        $sub_title->setLabel('Sub title:')
              ->setRequired(false)
              ->addFilter('StripTags');
             
        $description = new Zend_Form_Element_Textarea('description');
        $description->setLabel('Description:')
               ->setRequired(true)
               ->addFilter('StripTags')
               ->addValidator('NotEmpty');
			   
        $content = new Zend_Form_Element_Textarea('content');
        $content->setLabel('Content:')
               ->setRequired(true)
               ->addFilter('StripTags')
               ->addValidator('NotEmpty');			   
               
        $author = new Zend_Form_Element_Text('Author');
        $author->setLabel('Author:')
              ->setRequired(true)
              ->addFilter('StripTags');               
               
               
        $allow_comment = new Zend_Form_Element_Checkbox('allow_comment');
		$allow_comment->setLabel('Allow user comment:');
		
        $hot_article = new Zend_Form_Element_Checkbox('hot_article');
		$hot_article->setLabel('Hot article:');	

		$category = new Zend_Form_Element_Multiselect('category');
		$category->setLabel('Category:');	
       
		$tag = new Zend_Form_Element_MultiCheckbox('tag');
		$tag->setLabel('Tags:');	
	   
        $submit = new Zend_Form_Element_Submit('submit');
        $submit->setAttrib('id', 'submitbutton');
		
		$preview = new Zend_Form_Element_Submit('preview');
        $preview->setAttrib('id', 'previewbutton');
		
		/* Load form data */
		
		/* Language */
		
		/* Category */
		
		/* Tag */

        $this->addElements(array($language, $article_id, $main_title, $sub_title, 
			$description, $content, $author, 
			$allow_comment, $hot_article, $category, $tag));
    }
}